1. Field of the Invention
The present invention relates to an apparatus for producing dot data or dot-matrix data from outline data defining one or more outlines of an image such as a character.
2. Related Art Statement
There is known a data processing device which processes outline data including a plurality of sets of point data, i.e., sets of x and y coordinates which cooperate with each other to define, in the x-y coordinate system, one or more outlines of an image such as a character (e.g., letter, numeral, symbol, figure, etc.). The data processing device produces dot-matrix data from the outline data, so that an output device such as a printer or a display outputs the image according to the dot-matrix data. The dot-matrix data include (a) a plurality of sets of "ON" data (or "OFF" data) defining the inside area of the output image and (b) a plurality of sets of "OFF" data (or "ON" data) defining the outside area of the output image. Each set of "ON" or "OFF" data corresponds to a unit area of the x-y coordinate system or plane, on one hand, and corresponds to a picture element of the output image, on the other hand.
The process of producing dot-matrix data from outline data may easily be understood by assuming a picture-element screen 31, as shown in FIG. 16, which conceptionally defines the picture elements of an output image to be produced by the output device. The picture-element screen 31 is constructed by (a) a number of straight lines extending parallel to a Y axis and passing through respective integral coordinates of an X axis which is perpendicular to the Y axis and cooperates with the Y axis to provide a two-dimensional coordinate system, and (b) a number of straight lines extending parallel to the X axis and passing through respective integral coordinates of the Y axis. In this case, each picture element of the output image corresponds to a square unit area defined by (a) two adjacent straight lines parallel to the Y axis and (b) two adjacent straight lines parallel to the X axis, and those four straight lines provide the four boundary lines of the square unit area.
A raster-scanning method using a picture-element screen is widely used for producing dot-matrix data from outline data. This method will be described in detail by reference to the outline data of a character "n" shown in FIG. 2. First, the outline data, or outline defined thereby are assumed to be superposed on the picture-element screen. Next, a single straight scanning line is assumed to extend parallel to the X or Y axis and pass over the centers of square unit areas of the picture-element screen, i.e., picture elements of the output image. Subsequently, all the intersecting point or points of the scanning line and the character outline is/are determined. Based on the position or positions of the intersecting point or points, a set of "ON" or "OFF" data is given to each of the square unit areas currently under the scanning line, according to a predetermined rule, so that one or more sets of "ON" data substantially define the inside area of the character outline and one or more sets of "OFF" data substantially define the outside area of the character outline. Thus, one row or one column of the dot-matrix data is produced. By repeating this operation moving the scanning line all over the picture-element screen, the entire dot-matrix data are produced for the character as a whole. In this way, the dot-matrix data are produced from the outline data.
Alternatively, after the original or first outline data are transformed into second outline data defining a transformed outline having a changed size, the second outline data may be converted into dot-matrix data in the same manner as described above. In this case, it is possible to obtain various sizes of transformed outlines or images from a single set of original outline data. The process of changing the size of an outline or image defined by outline data will be described by reference to the outline data of character "n" of FIG. 2. This process may be performed by transforming the sets of point data, i.e., sets of x and y coordinates of the outline data in such a way that each picture element of an output image corresponds to a square unit area whose four vertices are defined by two adjacent transformed x integral coordinates and two adjacent transformed y integral coordinates. Assuming that a desired size of the output image be selected at a value, p (points; p=1 is equal to 1/72 inch), by an operator or user through an input device such as a keyboard, that the resolution of the output device be specified at a value, d (dots per inch), and that the original size of the image be defined at a value, e, by the original outline data, then a transformation coefficient, Z, for the above coordinate transformation is obtained by the following expression: EQU Z=(p.times.d)/(I.times.e)
where I is a constant, i.e., 72 (points per inch).
Additionally, the operator may input, through the input device, data indicative of a desired position of the output image, i.e., parallel-translation amount of the image with respect to the X and/or Y axis. Therefore, this coordinate transformation is generally expressed by the following transformation function, i.e., linear function: EQU v'=Z.times.v+T
where Z is the transformation coefficient with respect to the X and/or Y axis; PA1 T is the parallel-translation amount with respect to the X and/or Y axis; PA1 v is each of the x and/or y coordinates of the original outline data; and PA1 v' is a corresponding one of the x and/or y coordinates of the transformed outline data. PA1 p is a desired size value of the image input through an input device; PA1 d is a resolution of the image defined by the dot-matrix data; PA1 e is an original size value of the image defined by the first outline data; and PA1 I is a constant, PA1 Z is a transformation coefficient with respect to the at least one of the X axis and the Y axis, the transformation data comprising the transformation coefficient; and PA1 p' is the corrected coordinate corresponding to the one original coordinate p.
Hereinafter, the original outline data are referred to as the "outline data A" and the transformed outline data are referred to as the "outline data B".
If the outline data B are superposed on a picture-element screen 31 as shown in FIG. 16 and subsequently the outline data B are subjected to the raster-scanning method to produce dot-matrix data, the dot-matrix data produced may suffer from low quality because quantization errors may occur when the outline data B are converted into the dot-matrix data. FIG. 16 shows the dot-matrix data including the sets of "ON" data (indicated by hatching) produced from the outline data B by the raster-scanning method. As can been seen from the figure, vertical parts 33, 34 of the dot-matrix data have different widths whereas the counter parts of the outline data B have the same width. Thus, the dot image, i.e., output image may give a strange impression to observers.
For solving the above problem, it has been practiced to automatically adjust the position and width of a vertical or horizontal part of a transformed image, and thereby control the number of picture elements to be located between the two opposite outline portions of the vertical or horizontal part. One of the known methods will be described below.
First, line-spacing data are prepared which include (a) position data including two x or y coordinates defining a vertical or horizontal part to be adjusted and (b) spacing data defining the distance between the two coordinates. Thus, the line-spacing data define the width of the vertical or horizontal part. More specifically, a set of x line-spacing data for a vertical part includes (a) x position data including two x coordinates and (b) x spacing data defining the difference or distance between the two x coordinates. Similarly, a set of y line-spacing data for a horizontal part includes (c) y position data including two y coordinates and (d) y spacing data defining the difference or distance between the two y coordinates. FIG. 2 shows the outline data A of character "n" for which two sets of x line-spacing data are included for two vertical parts 20, 21 of the character "n".
Second, the line-spacing data are transformed according to a desired size of the output image. Regarding the character "n" of FIG. 2, the two x coordinates of each of the two sets of x line-spacing data 20, 21 are transformed by the same manner as used for the transformation of the outline data A into the outline data B, and the distance or width defined by the x spacing data of each set of x line-spacing data 20, 21 is multiplied by the transformation coefficient Z, and then is rounded by counting fractions of 0.5 and over as one and cutting away the rest, or otherwise cutting away fractions smaller than one. The thus obtained width will be referred to as the "dot width". The dot width just corresponds to an integral number of dots, i.e., picture elements of the output image. FIG. 16 shows the transformed sets of x line-spacing data 35, 36 respectively corresponding to the original sets of x line-spacing data 20, 21.
Third, one of the two transformed x coordinates of each transformed set of x line-spacing data 35, 36 which one coordinate has a smaller distance up to an x integral coordinate nearest thereto than that of the other transformed coordinate, is selected as a base coordinate, and the other transformed coordinate is selected as a dependent coordinate. The base coordinate is moved, i.e., rounded to that integral coordinate nearest thereto, which provides a corrected base coordinate. Otherwise, a smaller one of the two transformed coordinates may be selected as a base coordinate and be rounded to an integral coordinate as a corrected base coordinate by cutting away fractions smaller than one. Then, the dependent coordinate is moved to an integral x coordinate, i.e., corrected dependent coordinate, distant from the corrected base coordinate by the dot width. Subsequently, all the x coordinates of the outline data B equal to the base coordinate are corrected or moved to the corrected base coordinate, and all the x coordinates of the outline data B equal to the dependent coordinate are corrected or moved to the corrected dependent coordinate.
FIG. 17 shows outline data C obtained by correcting the outline data B as described above. The two sets of x line-spacing data 35, 36 of FIG. 16 are corrected to two sets of x line-spacing data 413, 414 of FIG. 17, respectively. In FIG. 17, black circles 40, 41, 42, 43, 44, 45, and 46 indicate the x coordinates corrected based on the transformed and corrected x line-spacing data 35, 413, and black circles 47, 48, 49, 410, 411, and 412 indicate the x coordinates corrected based on the transformed and corrected x line-spacing data 36, 414. The outline data C are converted into dot-matrix data indicated by hatching in FIG. 17 wherein the vertical parts 33, 34 of the dot-matrix data have the same width. Thus, the dot-matrix data enjoy high quality.
In short, the outline data A are first subjected to size changing to provide the outline data B, which in turn are subjected to correction of quantization errors to provide the outline data C, which in turn are subjected to the raster-scanning method using the picture-element screen 31 to provide the dot-matrix data.
In the above conventional process, however, it is not necessary, but actually is carried out, to transform the original x coordinates (indicated by black circles in FIG. 2) of the outline data A which are to be corrected when the outline data B are corrected to the outline data C, because those original x coordinates can be corrected without utilizing the corresponding transformed x coordinates of the outline data B. This applies to the original y coordinates to be corrected, if any. This problem leads to increasing the production cost of the dot-matrix data and lowering the production efficiency of the dot-matrix data.